﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
    namespace="Agathas.Storefront.Model.Basket"
        assembly="Agathas.Storefront.Model">

  <class name="BasketItem" table="BasketItems" lazy="false" >

    <id  name="Id" column="BasketItemId" unsaved-value="0">
      <generator class="native" />
    </id>
        
    <component name="Quantity" class="Agathas.Storefront.Model.NonNegativeQuantity">
      <property column="Quantity" name="Value">
         <column name="Qty" sql-type="int" not-null="true" />
      </property>
    </component>

    <many-to-one access="field.camelcase-underscore" name="Product"
                     class="Agathas.Storefront.Model.Products.Product"
                     column="ProductId"
                     cascade="none"
					           not-null="true"/>


    <many-to-one access="field.camelcase-underscore" name="Basket"
                     class="Basket"
                     column="BasketId"
                     not-null="true"/>
  </class>
</hibernate-mapping>